package com.ymh.git.thread.juc.advance;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * Created by aivin on 2018/11/6.
 * <p>
 * 演示如何使用显示锁
 */
public class UseLock {


    public static void main(String[] args) {
        Lock lock = new ReentrantLock();
        lock.lock();//阻塞式加锁
        try {
            //TODO
            System.out.println(
                    "做具体的业务操作"
            );

        } finally {
            lock.unlock();
        }
    }
}
